package com.controller;

import com.model.DaoHang;
import com.model.MyNode;
import com.model.Public;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@Api("导航")
@RestController
public class DaoHangController {

    @CrossOrigin
    @ApiOperation(value = "根据用户主键获取操作模块的权限")
    @RequestMapping(value = "/getDaoHang",produces = "application/json;charset=utf-8",method = RequestMethod.PUT)
    public List<DaoHang> getDaoHang(@RequestBody Public Public){
        List<DaoHang> myDaoHangList = new ArrayList<>();
        List<MyNode> myNodeList1 = new ArrayList<>();

        MyNode myNode1 = new MyNode();
        myNode1.setText("国内疫情");
        myNode1.setHref("home.html");
        myNodeList1.add(myNode1);

        MyNode myNode2 = new MyNode();
        myNode2.setText("国外疫情");
        myNode2.setHref("");
        myNodeList1.add(myNode2);

        MyNode myNode3 = new MyNode();
        myNode3.setText("疫情出行");
        myNode3.setHref("map.html");
        myNodeList1.add(myNode3);

        MyNode myNode4 = new MyNode();
        myNode4.setText("新闻推送");
        myNode4.setHref("");
        myNodeList1.add(myNode4);

        MyNode myNode5 = new MyNode();
        myNode5.setText("大众疫情");
        myNode5.setHref("");
        myNodeList1.add(myNode5);

        DaoHang myDao = new DaoHang();
        myDao.setText("功能栏");
        myDao.setNodes(myNodeList1);

        myDaoHangList.add(myDao);

        return myDaoHangList;
    }
}
